package com.xuetang9.BBS.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xuetang9.BBS.dao.CustomDao;
import com.xuetang9.BBS.domain.Customer;
import com.xuetang9.BBS.service.CustomerService;



/**
 * 业务逻辑层
 * @author 
 *
 */

@Service
public class CustomerServiceImpl implements CustomerService {

	@Autowired
	private CustomDao  customerDao;
	
	@Override
	public boolean registe(Customer customer) {
	
		return customerDao.seve(customer)==1;
	}

	@Override
	public Customer login(String account, String password) {
		Customer customer =customerDao.findByAccAndPass(account, password);
		
		if(customer!=null){
			customer.setPassword(null);
		}
		return customer;
		
	
	}
	

}
